import request from '@/utils/request'

// 查询劳动合同列表
export function listContract(query) {
  return request({
    url: '/back/contract/list',
    method: 'get',
    params: query
  })
}

// 查询劳动合同详细
export function getContract(id) {
  return request({
    url: '/back/contract/' + id,
    method: 'get'
  })
}

// 新增劳动合同
export function addContract(data) {
  return request({
    url: '/back/contract',
    method: 'post',
    data: data
  })
}

// 修改劳动合同
export function updateContract(data) {
  return request({
    url: '/back/contract',
    method: 'put',
    data: data
  })
}

// 删除劳动合同
export function delContract(id) {
  return request({
    url: '/back/contract/' + id,
    method: 'delete'
  })
}


// 查询最新合同数 /back/contract/user
export function getContractUser(query) {
  return request({
    url: '/back/contract/user',
    method: 'get',
    params: query
  })
}


//查询履行中的劳动合同列表 /dev-api/back/contract/list/enable
export function listContractEnable(query) {
  return request({
    url: '/back/contract/list/enable',
    method: 'get',
    params: query
  })
}

//个人查询劳动合同列表
export function listContractUser(query) {
  return request({
    url: '/back/contract/contractList',
    method: 'get',
    params: query
  })
}


//终止合同 /dev-api/back/contract/status
export function updateContractStatus(data) {
  return request({
    url: '/back/contract/status',
    method: 'put',
    data: data
  })
}


// 导出履行中的劳动合同列表 
export function exportContractEnable(query) {
  return request({
    url: '/back/contract/export/enable',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}



